import AppointTaskModel from '../model/appointTask';

export async function AddTask(platform: string,appointDate: string, appointTime: string, touristInfo: string, touristNum: number) {
  let data: any = { appointDate, appointTime, touristInfo, touristNum, platform };
  const model2 = await AppointTaskModel.insert(data);
}

export async function UpdateTask(data: any, id) {
  // let data: any = { appointDate, appointTime, touristInfo, touristNum, platform };
  const model2 = await AppointTaskModel.update(data, id);
}

export async function GetTask(id: number) {
  return AppointTaskModel.findOne(id);
}

export async function GetTaskList(pageindex: string | undefined, platform) {
  return AppointTaskModel.getlist(Number(pageindex || 1), platform);
}

export async function DeleteTaskList(ids: string[], uuid: string) {
  if (ids.length === 0) return;
  await AppointTaskModel.delList(ids);
    // UserLogs('删除用户', '', ids.join(), 1, uuid);
}
